resource "google_access_context_manager_access_levels" "<%= ctx[:primary_resource_id] %>" {
  parent = "accessPolicies/${google_access_context_manager_access_policy.access-policy.name}"
  access_levels {
    name   = "accessPolicies/${google_access_context_manager_access_policy.access-policy.name}/accessLevels/<%= ctx[:vars]['access_level_name1'] %>"
    title  = "<%= ctx[:vars]['access_level_name1'] %>"
    basic {
      conditions {
        device_policy {
          require_screen_lock = true
          os_constraints {
            os_type = "DESKTOP_CHROME_OS"
          }
        }
        regions = [
    "CH",
    "IT",
    "US",
        ]
      }
    }
  }

  access_levels {
    name   = "accessPolicies/${google_access_context_manager_access_policy.access-policy.name}/accessLevels/<%= ctx[:vars]['access_level_name2'] %>"
    title  = "<%= ctx[:vars]['access_level_name2'] %>"
    basic {
      conditions {
        device_policy {
          require_screen_lock = true
          os_constraints {
            os_type = "DESKTOP_MAC"
          }
        }
        regions = [
    "CH",
    "IT",
    "US",
        ]
      }
    }
  }
}

resource "google_access_context_manager_access_policy" "access-policy" {
  parent = "organizations/123456789"
  title  = "my policy"
}
